#!/bin/sh

for i in `cat acc.list`;do
    echo "Extracting '$i'"
    for j in `cat $i.core.list`;do
        exfasta $j all.faa >> $i.90.fasta
    done
done

for i in `cat acc.list`;do
    echo "Editing '$i'"
    sed -i '/^>/d' $i.90.fasta
    cat dummy $i.90.fasta > $i.tmp
    sed -i 's/>/>'$i'/g' $i.tmp
    bp_seqconvert.pl --from fasta --to fasta < $i.tmp > $i.90.fasta
    rm $i.tmp
done
